package com.design.cjm.behavioral.chainofresponsibility.example;

/**
 * @Author: Jie Ming Chen
 * @Date: 2018/9/25
 * @Version 1.0
 */
public class TestApp {

    public static void main(String[] args) {

        Handler handler = new ConcreteHandler();
        Handler handler1 = new ConcreteHandler1();
        Handler handler2 = new ConcreteHandler2();

        handler.setSuccessor(handler1);
        handler1.setSuccessor(handler2);

        int[] requests = {2, 5, 14, 22, 18, 3, 27, 20};

        for (int request: requests) {
            handler.handleRequest(request);
        }
    }
}
